package com.woniuxy.mongdbtest.entity;

import com.alibaba.fastjson.JSONObject;

import lombok.Data;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 对应mongdb的医院
 * <P> Date: 2022/3/1:21:09
 * <P> Description:
 */
@Data
@Document("Hospital")
public class Hospital extends BaseMongoEntity {

	private static final long serialVersionUID = 1L;

	@Indexed(unique = true) //唯一索引
	private String hoscode;

	@Indexed //普通索引
	private String hosname;

	private String hostype;

	private String provinceCode;

	private String cityCode;

	private String districtCode;

	private String address;

	private String logoData;

	private String intro;

	private String route;

	private Integer status;

	//预约规则
	private BookingRule bookingRule;

	public void setBookingRule(String bookingRule) {
		this.bookingRule = JSONObject.parseObject(bookingRule, BookingRule.class);
	}

}

